﻿using System;
using DomainModel;
using Repository.Abstract;

namespace Repository.NHibernate
{
    public class StudyYearRepository : Repository<StudyYear>, IStudyYearRepository
    {
        public StudyYear GetStudyYearByDate(DateTime date)
        {
            return Session.QueryOver<StudyYear>().Where(y => y.BeginDate <= date && y.EndDate >= date).SingleOrDefault();
        }
    }
}